'use strict'

module.exports = {
	up: async (queryInterface, Sequelize) => {
		const { INTEGER, DATE, STRING } = Sequelize
		await queryInterface.createTable('menus', {
			id: { type: INTEGER, primaryKey: true, autoIncrement: true },
			pid: {
				type: INTEGER,
				defaultValue: 0,
			},
			_title: STRING(50),
			_path: STRING,
			_icon: STRING,
			role_level: {
				type: STRING,
				defaultValue: '[1,2,3]',
			},
			created_at: DATE,
			updated_at: DATE,
		})
	},
	down: async queryInterface => {
		await queryInterface.dropTable('menus')
	},
}
